Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize targeted_left_multiply for onehot source #5905

Closed
wants to merge 8 commits into from

Conversation

daxfohl
Copy link
Collaborator

@daxfohl daxfohl commented Oct 3, 2022

For onehot left_matrix, this is just a slice that's moved and multiplied by a constant. Speeds up 2x2 Kraus components by two times, 4x4 by six times, and so on. Will be useful for the _ConfusionChannel in #5851

Fixes #5903

@daxfohl daxfohl requested review from a team, vtomole and cduck as code owners October 3, 2022 06:24
@daxfohl daxfohl requested a review from tanujkhattar October 3, 2022 06:24
@CirqBot CirqBot added the size: S 10< lines changed <50 label Oct 3, 2022
@daxfohl daxfohl marked this pull request as draft October 3, 2022 06:35
@daxfohl daxfohl marked this pull request as ready for review October 3, 2022 07:08
@daxfohl
Copy link
Collaborator Author

daxfohl commented Oct 8, 2022

@viathor Also closing this one because the new call to flatnonzero will likely be significant in the nominal case. However the same pattern can be used in _apply_channel_ eventually if so desired.

@daxfohl daxfohl closed this Oct 8, 2022
@daxfohl daxfohl deleted the speedup-linalg2 branch October 8, 2022 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: S 10< lines changed <50
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimize targeted_left_multiply for onehot operators
2 participants